package stylistcrm.core.query;

/**
 * Created by yanwc on 2016/8/10.
 */
public enum Sorting {
    Ascending,Descending;

    public static Sorting getSortingFromString(String value){
        if("Ascending".equals(value)){
            return Ascending;
        }else if("Descending".equals(value)){
            return Descending;
        }else{
            return Descending;
        }
    }

    /**
     * Boolean 值转排序字段
     * @param value True 按照升序排序 False降序排序
     * @return 排序值
     */
    public static Sorting getSortingFromBoolean(boolean value){
        if(value){
            return Ascending;
        }else{
            return Descending;
        }
    }
}
